﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace CPEBookWin
{
    public partial class AjoutStatutControl : UserControl
    {

        public string Texte {
            get { return txtStatut.Text; }
            set { txtStatut.Text = value; }
        }

        public TextBox textStatut
        {
            get { return txtStatut; }
            set { txtStatut = value; }
        }

        public Button boutonAjouter
        {
            get { return btnAdd; }
            set { btnAdd = value; }
        }

        public AjoutStatutControl()
        {
            InitializeComponent();
        }

        /// <summary>
        /// Evenement quand on appui sur une touche
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void txtStatut_KeyPress(object sender, KeyPressEventArgs e)
        {
            if (e.KeyChar == (char)Keys.Enter)
            {
                btnAdd.PerformClick();
                e.Handled = true;
            }
        }
    }
}
